package com.shop.cloud.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
@Configuration
@ComponentScan
public class ConfigUtil {
	/**
	 * 上传文件存储的绝对路径
	 */
	@Value("${upload.absolute.file.path}")
	private String uploadAbsoluteFilePath;

	/**
	 * 访问的base路径
	 */
	@Value("${upload.access.file.path}")
	private String uploadAccessFilePath;

	/**
	 * 默认大小 50M
	 */
	@Value("${upload.file.max.size}")
	private String uploadFileMaxSize;
	@Value("${download.absolute.file.path}")
	private String downloadAbsoluteFilePath;
	@Value("${qiniu.access_key}")
	private String qiNiuAccessKey;
	@Value("${qiniu.secret_key}")
	private String qiNiuSecretKey;
	@Value("${qiniu.bucketname}")
	private String qiNiuBucketname;
	@Value("${qiniu.access_url}")
	private String qiNiuAccessUrl;
	@Value("${jpush.master_secret}")
	private String jpushMasterSecret;
	@Value("${jpush.app_key}")
	private String jpushAppKey;
	
	@Value("${weixin.callback.url}")
	private String weixinCallbackUrl;
	@Value("${alipay.callback.url}")
	private String alipayCallbackUrl;

	public String getQiNiuAccessUrl() {
		return qiNiuAccessUrl;
	}

	public String getQiNiuAccessKey() {
		return qiNiuAccessKey;
	}

	public String getQiNiuSecretKey() {
		return qiNiuSecretKey;
	}

	public String getQiNiuBucketname() {
		return qiNiuBucketname;
	}

	public String getDownloadAbsoluteFilePath() {
		return downloadAbsoluteFilePath;
	}

	public Long getUploadFileMaxSize() {
		return Long.parseLong(uploadFileMaxSize);
	}

	public String getUploadAbsoluteFilePath() {
		return uploadAbsoluteFilePath;
	}

	public String getUploadAccessFilePath() {
		return uploadAccessFilePath;
	}

	public String getJpushAppKey() {
		return jpushAppKey;
	}

	public String getJpushMasterSecret() {
		return jpushMasterSecret;
	}

	public String getWeixinCallbackUrl() {
		return weixinCallbackUrl;
	}

	public void setWeixinCallbackUrl(String weixinCallbackUrl) {
		this.weixinCallbackUrl = weixinCallbackUrl;
	}

	public String getAlipayCallbackUrl() {
		return alipayCallbackUrl;
	}

	public void setAlipayCallbackUrl(String alipayCallbackUrl) {
		this.alipayCallbackUrl = alipayCallbackUrl;
	}

}
